﻿using System;
using System.Collections.Generic;

using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

using Gift.DAL;
using Gift.Model;

namespace WebSite.admin.warehouse
{
    public partial class stockGoodsAttributeEdit : BaseAdmin
    {
        readonly DALStockOrderGoods theStockOrderGoods = new DALStockOrderGoods();
        tbStockOrderGoods oStockOrderGoods;

        protected void Page_Load(object sender, EventArgs e)
        {

            if (!IsPostBack)
            {
                this.txtGoodsCount.Text = Request.QueryString["count"];
                this.txtSockPrice.Text = Request.QueryString["price"];
            }
        }

        protected void btnSaveRefresh_Click(object sender, EventArgs e)
        {

            oStockOrderGoods = theStockOrderGoods.GetModel(int.Parse(Request.QueryString["id"]));
            oStockOrderGoods.goodsCount = int.Parse(this.txtGoodsCount.Text.Trim());

            oStockOrderGoods.goodsStockPrice = decimal.Parse(this.txtSockPrice.Text);


            theStockOrderGoods.Update(oStockOrderGoods);


            ExtAspNet.PageContext.RegisterStartupScript(ExtAspNet.ActiveWindow.GetHidePostBackReference());
        }
    }
}